In map-based applications, a scene range shown by a client where each user (usually using a subject to implement) locates is called a visual field of a user. For the map-based application, a visual field list corresponding to each user is generally maintained in a map server. The visual field list is a user list that the client where the user locates should show. For example, for a user A, the visual field list corresponding to the user A includes 10 other users. The client where the user A locates should show the 10 other users in the visual field list.
A location of the user in a map scene often changes. When data in the visual field list corresponding to the user change, users shown by the client where the user locates in the map scene change too, i.e., the visual field of the user changes.
When state information of one user changes, the map server obtains state change information of the user in real time, and broadcasts the state change information of the user to the clients where other users locate in the visual field list corresponding to the user.
In one map scene, each user in the map needs to inform other users in the scene his state change information. The change information is verified by the server, and the server broadcasts the change information to clients of other users. The map scenes in prior map-based applications are usually very large. If the visual field list corresponding to the user includes all other users in the map scene where the user locates, when broadcasting state change information of the user, the map server costs a lot of resources.
A relationship between a total amount of broadcast package of the server and number of user in the scene is an n×n relationship. The more number of user in the scene is, the more number of broadcast package is. Calculating with conditions of a change information package being generated per person per second and size of the change information package being 500 bytes and there being 2000 persons in the scene, if all users in the scene are informed of state change of all persons, it will generate data flow of 500×2000×2000=2 GB/second=16 Gbps. This data flow is far beyond the endurance of a gigabit Ethernet card and meanwhile a CPU of the server is over endured.
A conventional way is to divide the map scene into a number of sub-grids. The server maintains those users on each sub-grid. A visual field list that a conventional map server maintains corresponding to a user includes users in a user-centered 3×3 grid range. The map server broadcasts state change information of the user to other users in the 3×3 grid range.
However, because users may crowd somewhere in the map scenes, the visual field list that the conventional map server maintains may still include a number of users in these map scenes. Therefore, when broadcasting state change information of the user, the conventional map server still costs a lot of resources. Broadcast pressure of the server is still large.